package com.ll.gulimall.order.feign;

import com.ll.common.to.SkuHasStockTo;
import com.ll.common.utils.R;
import com.ll.gulimall.order.vo.WareLockVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("gulimall-ware")
public interface WareFeignService {

    @PostMapping("/ware/waresku/hasStock")
    public R hasStock(@RequestBody List<Long> skuIds);

    @GetMapping("/ware/waresku/freight")
    public R getFreight(@RequestParam("addrId") Long addrId);

    /**
     * 锁定库存
     *
     * @param wareLockVo 需要锁定的数据
     * @return
     */
    @PostMapping("/ware/waresku/sku/lock")
    public R skuLock(@RequestBody WareLockVo wareLockVo);
}
